{extend name="public/base"/}
{block name="body"}
<title>添加/修改 - 设置 -</title>
<style type="text/css">
	.isshow{display:block;}
	.disshow{display:none;}
</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>设置管理<span class="c-gray en">&gt;</span> 设置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">公司名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.company}" id="company" name="company">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">公司地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.address}" id="address" name="address">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">经纬度：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.lat_lng}" placeholder="经纬度;例如:30.527540,114.346430" id="lat_lng" name="lat_lng">
                     <a href="http://lbs.qq.com/tool/getpoint/" target="_blank">
                     <p class="dizhi">*点击获取地理位置</p></a>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">公司邮箱：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.email}" id="email" name="email">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">服务电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.ser_tel}" id="ser_tel" name="ser_tel">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">服务时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.ser_time}" id="ser_time" name="ser_time">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">ICP备案：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.icp}" id="icp" name="icp">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">版权信息：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.copyright}" id="copyright" name="copyright">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">佣金比例：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="number" class="input-text" value="{$data.commission_scale}" id="commission_scale" name="commission_scale">
                <p style="color:#cccccc;font-size:10px;">上级获取下级支付费用的n%元</p>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">用户协议：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<script id="editor" name="protocol" type="text/plain" style="width:100%;height:400px;">{:htmlspecialchars_decode($data.protocol)}</script>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-3 col-sm-offset-2">
				<input id="submit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

$(function(){
	var ue = UE.getEditor('editor');
})
$("#submit").click(function() {
	layer.load(1, {
	  shade: [0.1,'#fff'] //0.1透明度的白色背景
	});
	var company=$("input[name=company]").val();
	var address=$("input[name=address]").val();
	var ser_tel=$("input[name=ser_tel]").val();
	var ser_time=$("input[name=ser_time]").val();
	var email=$("input[name=email]").val();
	var icp=$("input[name=icp]").val();
	var copyright=$("input[name=copyright]").val();
	var lat_lng=$("input[name=lat_lng]").val();
	var commission_scale=$("input[name=commission_scale]").val();
	var protocol=UE.getEditor('editor').getContent();
    $.ajax({
	    type: 'POST',
	    url: "{:url('system_set')}",
	    data: {company:company,protocol:protocol,commission_scale:commission_scale,lat_lng:lat_lng,copyright:copyright,icp:icp,email:email,ser_time:ser_time,ser_tel:ser_tel,address:address},
	    success: function(resdata){
	        if(resdata.code==200){
				layer.msg(resdata.msg,{icon:1,time:1000});
				setTimeout("location.reload()",1000);
	        }else{
				layer.msg(resdata.msg,{icon:2,time:3000});
	        }
	    },
	    error: function(){
			layer.msg('数据保存失败',{icon:2,time:3000});
	    }
	})
})
</script> 
{/block}